import { post } from '@/request/http'
import { toString } from '@/utils/utils'
import store from '@/store'


// 供应商管理
export const updateReturn = (data) =>
  post('/FTKJWLHYPT/system/updateReturnvisit',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            uuid: data.uuid,
            status: data.status,
            recode: data.recode
          }
        }
      }
    })
//获取查询列表 供应商审核
export const queryUseresA = ({
  fltName,
  userName,
  PageIndex,
  PageSize,
  fltAuditStatus
}) =>
  post('/FTKJWLHYPT/system/querySysCompanyDto',
    {
      Data: {
        Parameters: {
          FTKJWLHYPT: {
            fltName,
            userName,
            fltAuditStatus
          }
        },
        Orderby: {},
        PageIndex: {
          FTKJWLHYPT: PageIndex
        },
        PageSize: {
          FTKJWLHYPT: PageSize
        }
      }
    })

//审核
export const auditMethod = ({
  uuid,
  fltAuditStatus,
  version,
  gysServiceRate
}) => {
  return post('/FTKJWLHYPT/system/auditSysFleetUser', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          uuid,
          fltAuditStatus: String(fltAuditStatus),
          version: String(version),
          gysServiceRate
        }
      }
    }
  })
}

//评分 标准
export const getCriteria = () => {
  return post('/FTKJWLHYPT/enter/getrule', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          ruleId: 1
        }
      }
    }
  })
}
// 编辑获取分数接口
export const getCriteriaAdd = (data) => {
  return post('/FTKJWLHYPT/enter/getscore', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          fltUuid: data.fltUuid,
        }
      },
      Orderbys: {},
      PageIndex: {
        FTKJWLHYPT: ''
      },
      PageSize: {
        FTKJWLHYPT: ''
      }
    }
  })
}

//编辑 
export const getCriteriaEdit = (data) => {
  return post('/FTKJWLHYPT/enter/updatescore', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          fltTotal: data.fltTotal,
          fltUuid: data.fltUuid,
          score: data.score,
          project: data.project
        }
      },
      Orderbys: {},
      PageIndex: {
        FTKJWLHYPT: ''
      },
      PageSize: {
        FTKJWLHYPT: ''
      }
    }
  })
}

//查询当前用户供应商信息
export const queryCompanyInfo = ({
  fltUuid
}) => {
  return post('/FTKJWLHYPT/system/querySysCompanyInfo', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          fltUuid,
        }
      }
    }
  })
}

//查询当前供应商企业id查询供应商用户信息
export const queryCompanyUserInfo = ({
  uuid
}) => {
  return post('/FTKJWLHYPT/system/queryCompanyUserInfo', {
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          uuid,
        }
      }
    }
  })
}